Position sensors are used in many items of technology. Sometimes Hall-effect sensors are used to sense a magnetic field that changes in intensity based on a relative position of the Hall-effect sensor and some other item of interest. For example, a permanent magnet may be located in an edge of a display of a laptop computer, and a Hall-effect sensor may be located in a base of the laptop such that when the display is closed, the magnet and Hall-effect sensor are close to each other. The Hall-effect sensor thus can detect when the magnet is close (when the laptop is closed) and output a corresponding signal that can be used by the laptop to trigger turning off the display and possibly triggering other power saving activities.